<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<button type="button">删除</button>
		<ul>
			<li>jjj1</li>
			<li>jjj2</li>
			<li>kkkk3</li>
		</ul>
		<script type="text/javascript">
			//1.获取元素
			var ul = document.querySelector("ul");
			var btn = document.querySelector("button")
			//2.删除元素 node.removeChild(child)
			ul.removeChild(ul.children[0])
			//3.点击按钮依次删除里面的孩子
			btn.onclick = function() {
				if (ul.children.length == 0) {
					btn.disabled = true;
				} else {
					//node.removeChild()方法从dom中删除一个节点,并返回删除的节点
					ul.removeChild(ul.children[0]);
				}
			}
		</script>
	</body>
</html>
